//
//  KSearchFileCellFactory.m
//  KutulusLaw
//
//  Created by Mahmood1 on 12/11/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "KSearchFileCellFactory.h"

@implementation KSearchFileCellFactory
- (SearchFileCell *) createSearchFileCell:(KBaseSearchFileDTO *) searchFileDTO withOrderNumber:(NSUInteger)index {
	return [[SearchFileCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
}

- (SearchFileCell *) createSearchFileCell:(KBaseSearchFileDTO *) searchFileDTO withOrderNumber:(NSUInteger) index withNibName:(NSString *)nibName {
	SearchFileCell *cell = nil;
	
	
	NSArray* views = [[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil];
	for (UIView *view in views) {
		if([[view class] isSubclassOfClass:[SearchFileCell class]])
		{
			cell = (SearchFileCell *)view;
		}
	}
	
	if (cell) {
		[cell.orderNumberLabel setText:[NSString stringWithFormat:@"%d", index]];
		[cell setSearchFileDTO:searchFileDTO];
	}
	
	return cell;
}
@end
